#include"shm.hpp"
#include"namedpipe.hpp"

int main()
{
    Shm shm(gpathname,gproj_id,gUser);
    NamedPipe fifo(fifo_path,User);
    fifo.OpenForWrite();
    shm.Zero();
    //获取地址空间中共享内存的地址
    char* address = (char*)shm.GetAddress();
    //w端
    char info = 'A';
    int i = 0;
    std::string flag = "begin";

    while(info <= 'Z')
    {
        fifo.WritePipe(flag);
        std::cout<<"client is writing: "<<info<<std::endl;
        address[i] = info;
 
        i++;
        info++;
        sleep(2);
    }
    return 0;
}